<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简单计数器</title>
</head>
<body>

    <h1>计数器</h1>
    <p>当前值: <span id="counterValue">0</span></p>
    <button onclick="increaseCounter()">增加</button>
    <button onclick="decreaseCounter()">减少</button>

    <script>
        // 初始化计数器值
        let counter = 0;

        // 更新页面上的计数器值
        function updateCounter() {
            document.getElementById('counterValue').innerText = counter;
        }

        // 增加计数器值
        function increaseCounter() {
            counter++;
            updateCounter();
        }

        // 减少计数器值
        function decreaseCounter() {
            counter--;
            updateCounter();
        }
    </script>

</body>
</html>